From 9ba84005d494fa6ef7de5cd26e2e9e5e054bbcfa Mon Sep 17 00:00:00 2001 From: "robertlipe@gmail.com" Date: Wed, 1 Jan 2014 06:47:17 +0000 Subject: [PATCH] Fixes for mapbar, mapsource. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4697 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/mapbar_track.cc | 4 +++- gpsbabel/mapsource.cc | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gpsbabel/mapbar_track.cc b/gpsbabel/mapbar_track.cc index e74739bf6..daa24ced3 100644 --- a/gpsbabel/mapbar_track.cc +++ b/gpsbabel/mapbar_track.cc @@ -93,7 +93,9 @@ mapbar_track_read(void) // At this point, name is a UCS-16 encoded, zero terminated string. // All our internals use UTF-8 encoding, so convert now. int olen = strlen(name); - track->rte_name = cet_str_uni_to_utf8((const short int*) name, olen); + + QScopedPointerrte_name (cet_str_uni_to_utf8((const short int*) name, olen)); + track->rte_name = rte_name.take(); // skip two pair waypoint gbfseek(fin, 8*4, SEEK_CUR); diff --git a/gpsbabel/mapsource.cc b/gpsbabel/mapsource.cc index 687d90faa..ab8acb849 100644 --- a/gpsbabel/mapsource.cc +++ b/gpsbabel/mapsource.cc @@ -580,13 +580,13 @@ mps_waypoint_r(gbfile* mps_file, int mps_ver, waypoint** wpt, unsigned int* mpsc if ((mps_ver == 4) || (mps_ver == 5)) { gbfread(tbuf, 6, 1, mps_file); /* unknown */ QScopedPointerwptnotes (gbfgetcstr(mps_file)); - thisWaypoint->notes = *wptnotes; + thisWaypoint->notes = wptnotes.take(); } else { gbfread(tbuf, 2, 1, mps_file); /* unknown */ } thisWaypoint->shortname = wptname; - thisWaypoint->description = *wptdesc; + thisWaypoint->description = wptdesc.take(); thisWaypoint->latitude = GPS_Math_Semi_To_Deg(lat); thisWaypoint->longitude = GPS_Math_Semi_To_Deg(lon); thisWaypoint->altitude = mps_altitude; @@ -959,7 +959,7 @@ mps_route_r(gbfile* mps_file, int mps_ver, route_head** rte) #endif rte_head = route_head_alloc(); - rte_head->rte_name = *rtename; + rte_head->rte_name = rtename.take(); route_add_head(rte_head); *rte = rte_head; @@ -1563,7 +1563,7 @@ mps_track_r(gbfile* mps_file, int mps_ver, route_head** trk) #endif track_head = route_head_alloc(); - track_head->rte_name = *trkname; + track_head->rte_name = trkname.take(); track_add_head(track_head); *trk = track_head; -- 2.30.2